1. Field of the Invention
The present invention relates to a transcoder for converting an input stream into a different output stream, and more particularly to a technique to appropriately control the amount of generated codes of the output stream toward a target bit rate.
2. Description of the Background Art
Images to be delivered on digital broadcasts, those to be stored in media such as DVDs and hard disks, and the like are compressed in accordance with various coding systems. The object for such compressions is to avoid constraint on a transmission band, increase the transmission speed, decrease the memory size or the like.
There are various standards for image coding system, such as MPEG2 and H.264. And there is a case where the coding system is converted for the purpose of reducing the amount of codes in a coded image that is inputted, or the like. A transcoder once decodes the inputted coded image. Then, the transcoder codes the decoded image in a different coding system (or the same coding system) again. Thus, the transcoder controls a bit rate of an output stream.
Japanese Patent Application Laid Open Gazette No. 2006-74635 relates to a transcoder for converting an image compressed in a first compressive coding system into an image compressed in a second compressive coding system. This transcoder uses intermediate information generated during the decoding of the image compressed in the first compressive coding system to compress the image in the second compressive coding system.
In a rate control technique that has been conventionally used, image data of known format (frame rate/image size) is used as an input. Further, parameters for coding such as a target bit rate or GOP picture structure (IBBP . . . ) are intentionally determined by a user, and after determining these parameters, the coding is started.
In other words, before coding of a sequence, these information is given as known parameters, and these parameters are not changed during the coding of the sequence. Therefore, it is possible to intentionally perform a bit assignment for control of rate in advance to some degree.
On the other hand, in a rate control by a transcoder, a target bit rate of a whole output stream is set by a user, and specifications of an input stream, i.e., image size (format), frame rate, GOP picture structure, bit rate and the like, can not be recognized until a certain unit of the input stream (e.g., a sequence header, a picture header or one whole GOP) is decoded. Further, there is sometimes a case where an input stream consists of a plurality of different streams which are edited by cut and paste. In such a case, sometimes, the above specifications of the input stream are changed during the decoding. Though it is possible to solve this problem by recoding the decoded image after acquiring information obtained in the course of decoding of the input stream in advance, there disadvantageously arises a delay in an output by the streams to be taken in advance. For this reason, in a case of transcoding in one pass in real time, a system different from the background-art technique is needed in order to achieve an averaged bit rate of the output stream.